package cn.xiangxu.webfulx_structure.controller;

import cn.xiangxu.webfulx_structure.domain.StudentDO;
import cn.xiangxu.webfulx_structure.repository.StudentReporitory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;

/**
 * @author 王杨帅
 * @create 2018-08-07 21:06
 * @desc 测试实体类
 **/
@RestController
@RequestMapping(value = "/test")
@Slf4j
public class TestController {

    private final StudentReporitory studentReporitory;

    public TestController(StudentReporitory studentReporitory) {
        this.studentReporitory = studentReporitory;
    }

    @GetMapping(value = "/connect")
    public String connect() {
        String result = "前后台连接成功_王杨帅";
        log.info(result);
        return result;
    }

    @GetMapping(value = "/test01")
    public Flux<StudentDO> test01() {
        return studentReporitory.findAll();
    }


}

